home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / program / swmp141.zip / C.DOC < prev    next >
Text File  |  1995-12-12  |  6KB  |  145 lines

  1.  
  2.  ┌────────────────────────────────────────────────────────────────────────────┐
  3.  │ Module Player V1.41     (c) 1994,1995 by Lord Excess of Sound Wizards Int. │
  4.  └────────────────────────────────────────────────────────────────────────────┘
  5.  
  6.  
  7.  
  8.         USING THE SWMP DRIVERS WITH 'BORLAND C'
  9.         ───────────────────────────────────────
  10.  
  11.          First of all you have to unzip the files of the included
  12.         archive C_SDK.ZIP into an existing directory.
  13.         The files you need in any case are:
  14.  
  15.               MODPLAY.INC           : interface to drivers
  16.               MOD_DRV.OBJ           : all sound drivers
  17.  
  18.          The rest are example files, which can be important to
  19.         understand things better. Now you have to perform two steps to
  20.         use all mod-routines:
  21.  
  22.          1. Add the following expression to your source code:
  23.  
  24.               #include "modplay.inc"
  25.  
  26.          2. For a successfull link of the drivers you best open a
  27.             project file, else you have to study the syntax of your
  28.             linker... After that add the file "mod_drv.obj" and of
  29.             course all of your source files.
  30.  
  31.          At program start you have to initialize one of the drivers
  32.         using the following subroutine:
  33.  
  34. ┌──INIT DRIVER─────────────────────────────────────────────────────────────────
  35. │       void MOD_Init(unsigned int Driver, unsigned int Port,
  36. │                     unsigned char IRQ, unsigned char DMA)
  37. │         -> Select and initialize driver for sound output
  38. │            Driver = Detection         (0) :  Port = 0
  39. │                                              IRQ  = 0
  40. │                                              DMA  = 0
  41. │                   = SoundBlaster      (1) :  Port = SB base address (x220..)
  42. │                                              IRQ  = SB IRQ#
  43. │                                              DMA  = 1 (always)
  44. │                   = SoundBlaster_Pro  (2) :  Port = SBP base address
  45. │                                              IRQ  = SBP IRQ#
  46. │                                              DMA  = SBP DMA channel
  47. │                   = Gravis_UltraSound (3) :  Port = GUS base address
  48. │                                              IRQ  = GF1 IRQ#
  49. │                                              DMA  = MIDI IRQ# !!
  50.  
  51.          A very powerful hardware detection is able to detect any
  52.         supported soundcard with all required settings. So in general
  53.         the easiest way to init the drivers is:
  54.  
  55.                 MOD_Init(Detection,0,0,0);
  56.  
  57.          If all fails you can override detection and select one of the
  58.         drivers by yourself, but in this case you have to know (or ask
  59.         for) the settings of an installed soundcard.
  60.  
  61.  
  62.          If you want to know if initialisation was successfull, have a
  63.         look at the variable (unsigned int) Soundcard, which will
  64.         contain the output device:
  65.  
  66.               0:        no sound available
  67.               1:        SoundBlaster            [ 22.2 kHz mono     ]
  68.               2:        SoundBlaster Pro        [ 21.7 kHz stereo   ]
  69.               3:        Gravis UltraSound       [ 44.1 kHz +stereo+ ]
  70.  
  71.          You do not have to handle this variable. You can also call the
  72.         driver's subfunctions even if no soundcard was detected,
  73.         nothing will happen in this case.
  74.  
  75.          At program end the unit selfrestores any altered interrupt
  76.         vectors etc.
  77.  
  78.          The following functions are now available:
  79.         (Note: The first two functions are enough to playback a mod !!!)
  80.  
  81. ┌──LOAD MODULE─────────────────────────────────────────────────────────────────
  82. │       void Mod_Load(char far *File_Name)
  83. │         -> Stops possible sound output, loads module file into memory,
  84. │            but does not start playing. If successfull the variable
  85. │            (unsigned int) Channels will contain the number of channels,
  86. │            else zero.
  87. ┌──PLAY MODULE─────────────────────────────────────────────────────────────────
  88. │       void Mod_Play(unsigned int Looping)
  89. │         -> Starts playing previously loaded song. If looping is zero,
  90. │            song is played only once, else continuously.
  91. ┌──STOP MODULE─────────────────────────────────────────────────────────────────
  92. │       void Mod_Stop(void)
  93. │         -> Stops sound output at once.
  94. ┌──MAIN VOLUME─────────────────────────────────────────────────────────────────
  95. │       void Mod_Volume(unsigned char Volume)
  96. │         -> Changes the driver's main volume setting. Valid values are
  97. │            between 0 (lowest) and 64 (loudest).
  98. ┌──STATUS──────────────────────────────────────────────────────────────────────
  99. │       unsigned int Mod_Status(void)
  100. │         -> Returns 1 if sound is being played, else 0.
  101. ┌──GET POSITION────────────────────────────────────────────────────────────────
  102. │       unsigned int Mod_Position(void)
  103. │         -> Returns 256*PatternNumber+LineNumber. Can be useful to
  104. │            syncronize a special graphic effect to the sound.
  105. ┌──JUMP BACK───────────────────────────────────────────────────────────────────
  106. │       void Mod_Rewind(void)
  107. │         -> Decreases current songposition. No effect in first pattern.
  108. ┌──JUMP FORWARD────────────────────────────────────────────────────────────────
  109. │       void Mod_Forward(void)
  110. │         -> Increases current songposition. No effect in last pattern.
  111. ┌──PEAKS───────────────────────────────────────────────────────────────────────
  112. │       void Mod_Peak(void)
  113. │         -> Updates the array Peaks by copying the driver's volume
  114. │            setting (0..64) of each channel. The number of channels
  115. │            can be found in the variable Channels (WORD) and is either
  116. │            four, six or eight.
  117.  
  118.  
  119.  
  120.          In general it remains to be said that you can do as much error
  121.         checking as you like, but it is not necessary. In a demo or
  122.         intro for example you do not care if there is sound available
  123.         to the grafix you produce on the screen (in most cases). But in
  124.         a player it is evident that you need to have any sounddevice at
  125.         all to output the sound! The best way is to take a look at the
  126.         example programs. Have a lot of fun!
  127.  
  128.  
  129.                                                Lord Excess in Dezember '95
  130. 
  131.